#ifndef only_detect_h
#define only_detect_h

#include "detector.h"
#include <memory>

#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>

// #include "lidar2cam_fusion/Box.h"   // 自定义box消息
// #include "lidar2cam_fusion/Boxes.h"

#include "detect_msgs/Box.h"
#include "detect_msgs/Boxes.h"

class SubAndPubImg : public DetectNode 
{ 
 private:
  ros::NodeHandle n_;
  std::string topic_img_, topic_img_new_, topic_boxes_, frame_id_;
  bool is_pub_detect_img_;

  cv::Mat img_;
  sensor_msgs::ImagePtr msg_img_;
  image_transport::Publisher pub_img_;
  image_transport::Subscriber sub_img_;
  
  ros::Publisher pub_box_;
  detect_msgs::Boxes msg_boxes_;

 public:
  SubAndPubImg(std::string engine_path,float conf_thres, float nms_thresh, ros::NodeHandle n);
  void pubImg(const sensor_msgs::ImageConstPtr& msg);
};

#endif